{template 'header', $module}
<div class="tinfo">
{if $type == 3}
	<div class="menu">
	<table cellpadding="0" cellspacing="0">
	<tr>
	<td class="tab_on" id="Tab0"><a href="chat.php"><span>我的对话</span></a></td>
	<td class="tab_nav"></td>
	<td class="tab"><a href="message.php?action=setting" target="_blank"><span>黑名单</span></a></td>
	</table>
	</div>


	<form action="chat.php" onsubmit="return check();" target="_blank" id="dform">
	<table cellpadding="6" cellspacing="1" class="tb">
	<tr>
	<td class="tl"><span class="f_red">*</span> 输入会员名</td>
	<td class="tr">
	<input type="text" size="20" name="touser" id="touser"/> 
	<input type="submit" value=" 发起对话 " class="sBtn"/>
	<span id="dtouser" class="f_red"></span></td>
	</tr>
	</table>
	</form>
	<script type="text/javascript">
	function check() {
		if(Dd('touser').value.length < 2) {
			Dmsg('请输入会员名', 'touser');
			return false;
		}
		return true;
	}
	</script>
<style type="text/css">
.chat_list li {height:20px;line-height:20px;overflow:hidden;color:#908E9B;padding:0 5px 0 0;}
.chat_list span {color:#908E9B;}
.chat_on {background:#FAFAFA;}
.chat_offline {opacity:0.3;filter:Alpha(Opacity=30);}
</style>
<div class="chat_list">
<table cellpadding="0" cellspacing="0" width="100%">
<tr>
<td style="width:300px;line-height:30px;border-bottom:#DDDDDD 1px solid;padding:0 0 0 5px;"><strong>收到的对话</strong></td>
<td width="10">&nbsp;</td>
<td style="width:300px;line-height:30px;border-bottom:#DDDDDD 1px solid;padding:0 0 0 5px;"><strong>发起的对话</strong></td>
<td>&nbsp;</td>
<tr>
<td valign="top">
	{if $T}
	{loop $T $v}
	<table cellpadding="0" cellspacing="0" style="width:300px;margin:10px 0 0 5px;" onmouseover="this.className='chat_on';" onmouseout="this.className='';">
	<tr>
	<td width="60">
		<a href="chat.php?chatid={$v[chatid]}" target="chat_{$v[chatid]}"><img src="{useravatar($v[fromuser])}" width="48"{if $v[online]} title="会员在线"{else} title="会员离线" class="chat_offline"{/if}/></a>
	</td>
	<td>
	<ul>
	<li><span class="f_r">{$v[line]}</span><a href="chat.php?chatid={$v[chatid]}" target="chat_{$v[chatid]}">{$v[fromuser]}</a>({$v[truename]})</li>
	<li>{if $v[linkurl]}<a href="{$v[linkurl]}" target="_blank">{/if}<span>{$v[from]}</span>{if $v[linkurl]}</a>{/if}</li>
	</ul>		
	</td>
	</tr>
	</table>
	{/loop}
	{else}
	&nbsp;
	{/if}
</td>
<td>&nbsp;</td>
<td valign="top">
	{if $F}
	{loop $F $v}
	<table cellpadding="0" cellspacing="0" style="width:300px;margin:10px 0 0 5px;" onmouseover="this.className='chat_on';" onmouseout="this.className='';">
	<tr>
	<td width="60">
		<a href="chat.php?touser={$v[touser]}" target="chat_{$v[chatid]}"><img src="{useravatar($v[touser])}" width="48"{if $v[online]} title="会员在线"{else} title="会员离线" class="chat_offline"{/if}/></a>
	</td>
	<td>
	<ul>
	<li><span class="f_r">{$v[line]}</span><a href="chat.php?touser={$v[touser]}" target="chat_{$v[chatid]}">{$v[touser]}</a> ({$v[truename]})</li>
	<li><a href="{$v[linkurl]}" target="_blank"><span>{$v[from]}</span></a></li>
	</ul>	
	</td>
	</tr>
	</table>
	{/loop}
	{else}
	&nbsp;
	{/if}
</td>
<td>&nbsp;</td>
</tr>
</table>
</div>

<script type="text/javascript">setTimeout('window.location.reload();', 30000);</script>
{else}
	<link rel="stylesheet" type="text/css" href="{AJ_STATIC}{$MODULE[2][moduledir]}/image/chat.css"/>
	{if $type == 4}
	<div class="gb_tip">您还没有登录，请先留下您的联系方式再开始对话，以便对方联系您 您也可以点这里 <a href="{$AJ[file_login]}" class="t">登录</a> 或者 <a href="{$AJ[file_register]}" class="t">注册</a></div>
	<div class="gb_box">
		<form method="post" action="?" id="dform" onsubmit="return check();">
		<input type="hidden" name="action" value="contact"/>
		<input type="hidden" name="touser" value="{$touser}"/>
		<input type="hidden" name="mid" value="{$mid}"/>
		<input type="hidden" name="itemid" value="{$itemid}"/>
		<input type="hidden" name="forward" value="{$forward}"/>
		<table cellpadding="6" cellspacing="1" class="tb">
		<tr>
		<td class="tl"><span class="f_red">*</span> 联系人</td>
		<td class="tr"><input type="text" name="truename" size="30" id="truename"/> <span id="dtruename" class="f_red"></span></td>
		</tr>
		<tr>
		<td class="tl"><span class="f_red">*</span> 联系电话</td>
		<td class="tr"><input type="text" name="telephone" size="30" id="telephone"/> <span id="dtelephone" class="f_red"></span></td>
		</tr>
		<tr>
		<td class="tl">电子邮箱</td>
		<td class="tr"><input type="text" name="email" size="30" id="email"/></td>
		</tr>
		{if $AJ[im_qq]}
		<tr>
		<td class="tl">QQ </td>
		<td class="tr"><input type="text" size="20" name="qq" id="qq"/></td>
		</tr>
		{/if}
		<tr>
		<td class="tl"> </td>
		<td class="tr">
		<input type="submit" name="submit" value=" 开始对话 " class="sbm"/>
		</td>
		</tr>
		</table>
		</form>	
	</div>
	{load('guest.js')}
	<script type="text/javascript">
	function check() {
		var l;
		var f;
		f = 'truename';
		l = Dd(f).value.length;
		if(l < 2) {
			Dmsg('请填写联系人', f);
			return false;
		}
		f = 'telephone';
		l = Dd(f).value.length;
		if(l < 7) {
			Dmsg('请填写联系电话', f);
			return false;
		}
	}
	</script>
	{else}
	<script type="text/javascript">
	if(window.screen.width<1200){c(0);Dh('side');Dd('side_oh').className = 'side_s';}
	if(navigator.userAgent.indexOf('Firefox') != -1) document.write('<style>#chat{background-attachment:inherit;}</style>');
	var chat_id = '{$chat_id}';
	var chat_poll = {$chat_poll};
	var chat_maxlen = {$MOD[chat_maxlen]};
	var chat_mintime = {$MOD[chat_mintime]};
	var chat_status = {$chat_status};
	var chat_type = {$type};
	var chat_last = {$AJ_TIME};
	var chat_title = document.title;
	var chat_lang = {
		ec1:'按Enter键发送消息，按Ctrl+Enter键换行',
		ec2:'按Ctrl+Enter键发送消息，按Enter键换行',
		tip:'提示：系统不长久保存您的对话记录，关闭对话窗口将可能导致记录丢失，如果需要保存，请在交谈完毕之后点保存按钮',
		last:'ok'
	};
	</script>	
	<iframe src="" name="send" id="send" style="display:none;"></iframe>
	<div id="chat"></div>
	<div id="font" style="display:none;">
		<table cellspacing="0" cellpadding="0" width="100%">
		<tr>
		<td width="8" height="30"></td>
		<td width="120">
		<select id="font_s" onchange="font_init();">
			<option value="0">大小</option>
			<option value="10">10</option>
			<option value="11">11</option>
			<option value="12">12</option>
			<option value="13">13</option>
			<option value="14">14</option>
			<option value="16">16</option>
			<option value="18">18</option>
			<option value="20">20</option>
			<option value="24">24</option>
		</select>&nbsp;
		<select id="font_c" onchange="font_init();">
			<option value="0">颜色</option>
			<option value="1" style="background:#000000;">黑</option>
			<option value="2" style="background:#FF0000;">红</option>
			<option value="3" style="background:#0000FF;">蓝</option>
			<option value="4" style="background:#008040;">绿</option>
			<option value="5" style="background:#FF6600;">橙</option>
			<option value="6" style="background:#FF00FF;">粉</option>
		</select>
		</td>
		<td class="tool_a" id="tool_font_b" onclick="this.className=this.className=='tool_a' ? 'tool_b' : 'tool_a';font_init();"><img src="{AJ_STATIC}{$MODULE[2][moduledir]}/image/chat_font_b.gif" width="16" height="16" title="加粗"/></td>
		<td class="tool_a" id="tool_font_i" onclick="this.className=this.className=='tool_a' ? 'tool_b' : 'tool_a';font_init();"><img src="{AJ_STATIC}{$MODULE[2][moduledir]}/image/chat_font_i.gif" width="16" height="16" title="倾斜"/></td>
		<td class="tool_a" id="tool_font_u" onclick="this.className=this.className=='tool_a' ? 'tool_b' : 'tool_a';font_init();"><img src="{AJ_STATIC}{$MODULE[2][moduledir]}/image/chat_font_u.gif" width="16" height="16" title="下划线"/></td>
		<td>&nbsp;</td>
		<td class="c_p" width="15" onclick="font_hide();" title="点击关闭"><img src="{AJ_STATIC}{$MODULE[2][moduledir]}/image/close.gif"/></td>
		</tr>
		</table>
	</div>
	<div id="tool">
		<table cellspacing="0" cellpadding="0" width="100%">
		<tr>
		<td width="4">
			<div id="face" style="display:none;">
				<div><span onclick="face_hide();" title="点击关闭"><img src="{AJ_STATIC}{$MODULE[2][moduledir]}/image/close.gif"/></span><strong>选择表情</strong></div>
				{if $faces}
				<table cellspacing="0" cellpadding="0" title="点击选择">
				{loop $faces $k $v}
				{if $k%10==0}<tr>{/if}
				<td onmouseover="this.style.backgroundColor='#E3EEF3';" onmouseout="this.style.backgroundColor='';"><img src="face/{$v}.gif" onclick="face_into('{$v}');"/></td>
				{if $k%10==9}</tr>{/if}
				{/loop}
				</table>
				{/if}
			</div>
		</td>
		<td class="tool_a" onmouseover="this.className='tool_b';" onmouseout="if(Dd('font').style.display=='none')this.className='tool_a';" id="tool_font" onclick="font_show();"><img src="{AJ_STATIC}{$MODULE[2][moduledir]}/image/chat_font.gif" width="16" height="16" title="设置文字颜色和格式"/></td>
		<td class="tool_a" onmouseover="this.className='tool_b';" onmouseout="if(Dd('face').style.display=='none')this.className='tool_a';" id="tool_face" onclick="face_show();"><img src="{AJ_STATIC}{$MODULE[2][moduledir]}/image/chat_face.gif" width="16" height="16" title="表情"/></td>
		{if $MOD[chat_file] && $MG[upload]}
		<td class="tool_a" onmouseover="this.className='tool_b';" onmouseout="this.className='tool_a';" id="tool_file" onclick="Dfile({$moduleid}, '', 'chat', '{$MOD[chat_ext]}');"><img src="{AJ_STATIC}{$MODULE[2][moduledir]}/image/chat_file.gif" width="16" height="16" title="传文件"/></td>
		{/if}
		<td>&nbsp;</td>
		<td class="tool_a" onmouseover="this.className='tool_b';" onmouseout="this.className='tool_a';" id="tool_log" onclick="chat_log();"><img src="{AJ_STATIC}{$MODULE[2][moduledir]}/image/chat_log.gif" width="16" height="16" title="查看对话记录"/></td>
		<td class="tool_a" onmouseover="this.className='tool_b';" onmouseout="this.className='tool_a';" id="tool_save" onclick="chat_save();"><img src="{AJ_STATIC}{$MODULE[2][moduledir]}/image/chat_save.gif" width="16" height="16" title="保存对话记录"/></td>
		<td class="tool_a" onmouseover="this.className='tool_b';" onmouseout="this.className='tool_a';" id="tool_clear" onclick="Dd('chat').innerHTML='';"><img src="{AJ_STATIC}{$MODULE[2][moduledir]}/image/chat_clear.gif" width="16" height="16" title="清屏"/></td>
		</tr>
		</table>
	</div>
	<div class="word"><textarea id="word" onkeydown="return chat_key(event);" onfocus="Dh('ec');font_hide();face_hide();new_tip_stop();" class="f_gray" onclick="if(this.value==chat_lang.tip)this.value='';this.className='';"></textarea><script type="text/javascript">Dd('word').value=chat_lang.tip;</script></div>
	<div id="sBtns">
		<table cellspacing="0" cellpadding="0" width="100%">
		<tr>
		<td width="5"><img src="{AJ_STATIC}{$MODULE[2][moduledir]}/image/chat_foot_l.gif" width="5" height="30"/></td>
		<td><div id="tip" style="display:none;"></div></td>
		<td>&nbsp;</td>
		<td width="62"><img src="{AJ_STATIC}{$MODULE[2][moduledir]}/image/chat_c1.gif" width="69" height="21" onmouseover="this.src='image/chat_c2.gif';" onmouseout="this.src='image/chat_c1.gif';" onclick="chat_off();"/></td>
		<td width="8"> </td>
		<td width="62"><img src="{AJ_STATIC}{$MODULE[2][moduledir]}/image/chat_s1.gif" width="62" height="21" onmouseover="this.src='image/chat_s2.gif';" onmouseout="this.src='image/chat_s1.gif';" onclick="chat_send();" id="chat_s"/></td>
		<td width="21"><div id="ec" style="display:none;" onmouseover="Ds('ec');" onmouseout="Dh('ec');">
		<span id="ec1"><a href="javascript:ec_set(1);">按Enter键发送消息</a></span>
		<span id="ec2"><a href="javascript:ec_set(2);">按Ctrl+Enter键发送消息</a></span>
		</div><img src="{AJ_STATIC}{$MODULE[2][moduledir]}/image/chat_e1.gif" width="21" height="21" onmouseover="this.src='image/chat_e2.gif';" onmouseout="this.src='image/chat_e1.gif';" onclick="Ds('ec');"/></td>
		<td width="5"><img src="{AJ_STATIC}{$MODULE[2][moduledir]}/image/chat_foot_r.gif" width="5" height="30"/></td>
		</tr>
		</table>
	</div>
	<div id="sd"></div>
	<form method="post" action="chat.php" name="down" id="down" target="send">
	<input type="hidden" name="action" value="down"/>
	<input type="hidden" name="chatid" value="{$chatid}"/>
	<input type="hidden" name="data" value="" id="down_data"/>
	</form>
	<script type="text/javascript" src="{AJ_STATIC}file/script/chat.js"></script>
	{if $MOD[chat_file] && $MG[upload]}<script type="text/javascript" src="{AJ_STATIC}file/script/clear.js"></script>{/if}
	{/if}
</td>
<td width="8">&nbsp;</td>
<td valign="top" class="i_rt">
<div class="i_head">
<strong>对方信息</strong>
</div>
<div class="i_body">
	<div class="i_user">
	<table cellpadding="6" cellspacing="0" width="100%">
	{if $user[type] == 'guest'}
	<tr>
	<td class="i_user_l">会员类型</td>
	<td>游客</td>
	</tr>
	<tr>
	<td class="i_user_l">所在IP</td>
	<td>{$user[ip]}&nbsp;&nbsp;<a href="?action=black&username={$user[ip]}" class="t" onclick="return confirm('确定要屏蔽此IP吗？您将不再收到此IP的消息');">[屏蔽IP]</a></td>
	</tr>
	<tr>
	<td class="i_user_l">所在地区</td>
	<td>{$user[area]}</td>
	</tr>
	{else}
	<tr>
	<td class="i_user_l"><img src="{useravatar($user[username])}"/></td>
	<td style="line-height:24px;">&nbsp;<strong>{$user[username]}</strong> {if $online == 1}<span class="f_red">在线</span>{else}<span class="f_gray">离线</span>{/if}<br/>
	&nbsp;<a href="{$user[linkurl]}" target="_blank" class="t">{$user[company]}</a>
	</td>
	</tr>
	<tr>
	<td class="i_user_l">认证情况：</td>
	<td{if $user[validated]} title="企业资料通过{$user[validator]}认证"{/if}>
	{if $user[vip]}&nbsp;<img src="{AJ_SKIN}image/vip_{$user[vip]}.gif" align="absmiddle" alt="{VIP}" title="{VIP}:{$user[vip]}级"/>{/if}
	{if $user[vcompany]}&nbsp;<img src="{AJ_STATIC}{$MODULE[2][moduledir]}/image/v_company.gif" width="16" height="16" align="absmiddle" title="通过工商认证"/>{/if}
	{if $user[vtruename]}&nbsp;<img src="{AJ_STATIC}{$MODULE[2][moduledir]}/image/v_truename.gif" width="16" height="16" align="absmiddle" title="通过实名认证"/>{/if}
	{if $user[vbank]}&nbsp;<img src="{AJ_STATIC}{$MODULE[2][moduledir]}/image/v_bank.gif" width="16" height="16" align="absmiddle" title="通过银行帐号认证"/>{/if}
	{if $user[vmobile]}&nbsp;<img src="{AJ_STATIC}{$MODULE[2][moduledir]}/image/v_mobile.gif" width="16" height="16" align="absmiddle" title="通过手机认证"/>{/if}
	{if $user[vemail]}&nbsp;<img src="{AJ_STATIC}{$MODULE[2][moduledir]}/image/v_email.gif" width="16" height="16" align="absmiddle" title="通过邮件认证"/>{/if}
	&nbsp;	
	</td>
	</tr>
	<tr>
	<td class="i_user_l">公司地址：</td>
	<td>{$user[address]}&nbsp;</td>
	</tr>
	{if $user[postcode]}
	<tr>
	<td class="i_user_l">邮政编码：</td>
	<td>{$user[postcode]}</td>
	</tr>
	{/if}
	<tr>
	<td class="i_user_l">公司电话：</td>
	<td>{$user[telephone]}</td>
	</tr>
	{if $user[fax]}
	<tr>
	<td class="i_user_l">公司传真：</td>
	<td>{$user[fax]}</td>
	</tr>
	{/if}
	{if $user[mail]}
	<tr>
	<td class="i_user_l">电子邮件：</td>
	<td>{$user[mail]}</td>
	</tr>
	{/if}
	{if $user[truename]}
	<tr>
	<td class="i_user_l">联 系 人：</td>
	<td>{$user[truename]} （{if $user[gender]==1}先生{else}女士{/if}）</td>
	</tr>
	{/if}
	{if $user[department]}
	<tr>
	<td class="i_user_l">部门职位：</td>
	<td>{$user[department]}{if $user[career]} （{$user[career]}）{/if}</td>
	</tr>
	{/if}
	{if $user[mobile]}
	<tr>
	<td class="i_user_l">手机号码：</td>
	<td>{$user[mobile]}{if $AJ[sms] && $user[vmobile]}&nbsp;&nbsp;<a href="sms.php?action=add&auth={encrypt($user[mobile])}" target="_blank"><img src="{AJ_SKIN}image/sendsms.gif" align="absmiddle" title="发送短信" alt=""/></a>{/if}</td>
	</tr>
	{/if}
	<tr>
	<td class="i_user_l">即时通讯：</td>
	<td>
	{if $user[qq] && $AJ[im_qq]}{im_qq($user[qq])}&nbsp;{/if}
	{if $user[ali] && $AJ[im_ali]}{im_ali($user[ali])}&nbsp;{/if}
	{if $user[msn] && $AJ[im_msn]}{im_msn($user[msn])}&nbsp;{/if}
	{if $user[skype] && $AJ[im_skype]}{im_skype($user[skype])}&nbsp;{/if}
	&nbsp;<a href="?action=black&username={$user[username]}" class="t" onclick="return confirm('确定要屏蔽Ta吗？您将不再收到Ta的消息');">[屏蔽Ta]</a>
	</td>
	</tr>
	{/if}
	{if ($type == 2 || $type == 4) && $chat[forward]}
	<tr>
	<td class="i_user_l">来源页面：</td>
	<td><a href="{$chat[forward]}" target="_blank" class="l">点击访问</a></td>
	</tr>
	{/if}
	</table>
	</div>
</div>
</td>
</tr>
</table>
{/if}
<script type="text/javascript">s('chats');</script>
</div></div></div>
{template 'footer'}